﻿<Window x:Class="Netfraction.NICDetectorWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Netfraction"
    Title="Network Connection Detector" Height="318" Width="800" Loaded="Window_Loaded">
    <Window.Resources>
        <ResourceDictionary>
            <SolidColorBrush x:Key="MostActiveBrush" Color="LightGreen" />
            <Style x:Key="ItemContStyle" TargetType="{x:Type ListViewItem}">
                <Setter Property="HorizontalContentAlignment" Value="Stretch" />

                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsMostActive}" Value="true">
                        <Setter Property="Background" Value="{StaticResource MostActiveBrush}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <ListView Margin="12,12,12,0" Name="listViewNIC" ItemContainerStyle="{StaticResource ItemContStyle}" Height="199" VerticalAlignment="Top" SelectionChanged="listViewNIC_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="35">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <RadioButton IsChecked="{Binding Path=IsMostActive}" GroupName="ActiveButtons" IsEnabled="False"/>
                                </StackPanel>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="400" Header="Connection Name" DisplayMemberBinding="{Binding Path=ConnectionName}"/>
                    <GridViewColumn Width="125" Header="IP Address" DisplayMemberBinding="{Binding Path=IPAddress}"/>
                    <GridViewColumn Width="100" Header="Bytes Received" DisplayMemberBinding="{Binding Path=BytesReceived}" />
                    <GridViewColumn Width="75" Header="Speed" DisplayMemberBinding="{Binding Path=Speed}" />
                </GridView>
            </ListView.View>
        </ListView>
        <Button Height="30" HorizontalAlignment="Left" Margin="50,0,0,20" Name="editSelectionButton" VerticalAlignment="Bottom" Width="100" Click="editSelectionButton_Click">Edit Selection</Button>
        <Button Height="30" HorizontalAlignment="Right" Margin="0,0,50,20" Name="useSelectionButton" VerticalAlignment="Bottom" Width="100">Use Selection</Button>
    </Grid>
</Window>
